package com.gfl.trivialrestclient.controllers.forms;

import com.gfl.trivialrestclient.model.User;

/**
 * Command object to represent User object in web form
 * 
 * @author Bedlam
 * 
 */
public class UserCmd {
	private String login;
	private String password;
	private String confirmPassword;
	private String email;

	public UserCmd(String login, String password, String confirmPassword,
			String email) {
		this.login = login;
		this.password = password;
		this.confirmPassword = confirmPassword;
		this.email = email;
	}

	public String getLogin() {
		return login;
	}

	public void setLogin(String login) {
		this.login = login;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getConfirmPassword() {
		return confirmPassword;
	}

	public void setConfirmPassword(String confirmPassword) {
		this.confirmPassword = confirmPassword;
	}

	public static User buildUserFrom(UserCmd userCmd) {
		return new User(userCmd.getLogin(), userCmd.getPassword(),
				userCmd.getEmail());
	}

}
